<style scoped rel="stylesheet/scss" lang="scss">
	@import '../../css/public.css';
	@import '../../css/public.scss';


	section#MaxCon{
		width: 750px;
        height: 100%;
		position: relative;


	}
    .routerCon{
        height: 100%;
    }
    .bottomNav{
        position: fixed;
        bottom:0;
        left:0;
        width: 100%;
        z-index: 999;
    }


</style>
<template>
	<section id="MaxCon" :style="">
        
        <section class="routerCon">
            <router-view ref="router"></router-view>
        </section>

        <section class="bottomNav" v-show="isBottomNavShow">
    		<bottom-nav></bottom-nav>
        </section>

	</section>

</template>



<script type="text/javascript">
	import BottomNav from '../public/BottomNav/BottomNav'
	
	export default {
    // name: 'contnen',
    data () {
    	return {
    		isBottomNavShow: true,
    	}
    },
    components: {
    	BottomNav,
    	
    },
    methods:{
    	// chengePhotolist(msg){
    	// 	console.log(msg)
    	// }
    },
    computed: {
    	// getTest(){
    	// 	return this.$store.getters.getDataVal;
    	// },
    },

    watch:{
        isBottomNavShow: function(val, oldVal){
            // console.log(val);
            // console.log(oldVal);
        },

   	},
    mounted: function() {

        // this.$store.dispatch("getDataVal", {});

        let bottomNavActives = {
            "/":1,
            "/my":1,
            "/search":1,
            "/consult":1,
        }

        let self = this;

        self.$nextTick(() => {

        });

        let router = self.$router;

        // console.log(self);
        // console.log(self.$router);

        router.beforeEach((to, from, next) => {
            
            
            try{

                if( bottomNavActives.hasOwnProperty(to.path) ){
                    // console.log("需要激活！");
                    self.isBottomNavShow = true;
                }else{
                    // console.log("取消激活");
                    self.isBottomNavShow = false;

                }


            }finally{

                next();
            }

        });




    },

}
</script>